package com.jhx.demos.web.service.impl;

import com.jhx.demos.web.mapper.BufferMapper;
import com.jhx.demos.web.mapper.UserMapper;
import com.jhx.demos.web.pojo.BufferMessage;
import com.jhx.demos.web.pojo.Message;
import com.jhx.demos.web.pojo.User;
import com.jhx.demos.web.service.bufferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.awt.*;
import java.time.LocalDateTime;
import java.util.List;

@Service
public class bufferServiceimpl implements bufferService {

    @Autowired
    public BufferMapper buffermapper;



    @Override
    public List<BufferMessage> list() {
        return buffermapper.list();
    }


    @Override
    public void dellete(Integer id) {
        buffermapper.deleteById(id);
    }

    @Override
    public void updateMessageStatus(BufferMessage bmes) {
        buffermapper.updateMessageStatus(bmes);
        buffermapper.insert();
        //设置审核时间为当前时间
        bmes.setDatetime(LocalDateTime.now());
    }

    @Override
    public void manage(User user) {
        buffermapper.manage(user);

    }

    @Override
    public void insert() {
        buffermapper.insert();
    }


}

